package com.wuyou.sso.common.enums;

import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.wuyou.sso.common.annotation.DictValue;
import com.wuyou.sso.common.annotation.Label;
import com.wuyou.sso.common.annotation.MapDict;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 部门类型
 *
 * @author LHB
 * @date 2021/4/2 13:34
 */
@RequiredArgsConstructor
@MapDict(code = "dept-type", name = "部门类型")
public enum DeptTypeEnum implements IEnum<String> {


    /**
     * 订单中心
     */
    @Label("OMS")
    OMS("OMS", "OMS"),

    /**
     * 费用中心
     */
    @Label("BMS")
    BMS("BMS", "BMS"),

    /**
     * 场站
     */
    @Label("YMS")
    YMS("YMS", "YMS"),

    /**
     * 车队
     */
    @Label("TMS")
    TMS("TMS", "TMS"),

    /**
     * 仓库
     */
    @Label("WMS")
    WMS("WMS", "WMS"),

    /**
     * 客户
     */
    @Label("客户")
    CUS("CUS", "客户"),

    /**
     * 无
     */
    NONE("", "无");

    /**
     * 类型
     */
    @DictValue
    private final String type;

    /**
     * 描述
     */
    @JsonValue
    @Getter
    private final String description;

    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
    public static DeptTypeEnum getEnum(Object value) {
        return EnumUtil.likeValueOf(DeptTypeEnum.class, value);
    }

    @Override
    public String getValue() {
        return this.type;
    }
}
